package com.xone.xapp;

import org.json.JSONArray;
import org.json.JSONObject;

public class ProductGroupListUserHolder extends BasicListHolder {
	protected String id;
    protected String productId;
    protected String groupNum;
    protected String checkStatus;
    protected String remark;
    protected String dateCreated;
    protected String checkStatusName;
    
    protected String productName;
    protected String productTypeName;
    protected String productNum;
    protected String productDesc;
    protected String imageId;
	public ProductGroupListUserHolder(JSONObject jSONObject) {
		id = JSONUtils.getStringFromJSONObject(jSONObject,"id");
		productId = JSONUtils.getStringFromJSONObject(jSONObject,"productId");
		dateCreated = StringUtils.formatStringDate(JSONUtils.getStringFromJSONObject(jSONObject,"dateCreated"));
		checkStatus = JSONUtils.getStringFromJSONObject(jSONObject,"checkStatus");
		checkStatusName = JSONUtils.getStringFromJSONObject(jSONObject,"checkStatusName");
		groupNum = JSONUtils.getStringFromJSONObject(jSONObject,"groupNum");
		remark = JSONUtils.getStringFromJSONObject(jSONObject,"remark");
		JSONObject product = JSONUtils.getJSONObjectForKey(jSONObject, "product");
		productName = JSONUtils.getStringFromJSONObject(product,"productName");
		productTypeName = JSONUtils.getStringFromJSONObject(product,"productTypeName");
		productNum = JSONUtils.getStringFromJSONObject(product,"productNum");
		productDesc = JSONUtils.getStringFromJSONObject(product,"productDesc");
		JSONArray ids = JSONUtils.getJSONArrayForKey(product, "ids");
		if (null != ids && !ids.isNull(0)) {
			imageId = JSONUtils.getStringFromJSONArray(ids, 0);
		}
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getGroupNum() {
		return groupNum;
	}
	public void setGroupNum(String groupNum) {
		this.groupNum = groupNum;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setDateCreated(String dateCreated) {
		this.dateCreated = dateCreated;
	}
	public String getCheckStatus() {
		return checkStatus;
	}
	public void setCheckStatus(String checkStatus) {
		this.checkStatus = checkStatus;
	}
	public String getCheckStatusName() {
		return checkStatusName;
	}
	public void setCheckStatusName(String checkStatusName) {
		this.checkStatusName = checkStatusName;
	}
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}
	public String getProductTypeName() {
		return productTypeName;
	}
	public void setProductTypeName(String productTypeName) {
		this.productTypeName = productTypeName;
	}
	public String getProductNum() {
		return productNum;
	}
	public void setProductNum(String productNum) {
		this.productNum = productNum;
	}
	public String getProductDesc() {
		return productDesc;
	}
	public void setProductDesc(String productDesc) {
		this.productDesc = productDesc;
	}
	public String getImageId() {
		return imageId;
	}
	public void setImageId(String imageId) {
		this.imageId = imageId;
	}
	@Override
	public String getDateCreated() {
		return dateCreated;
	}
	@Override
	public String getDataCreatedName() {
		return "product.dateCreated";
	}

}
